<?php

/*
 * Copyright (C) 2014 University of Pittsburgh
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
class Constants {
    
  const HTML_INDENT_SIZE = 4;
  const JAVASCRIPT_INDENT_SIZE = 2;
  
  const MAC_OS = 1;
  const WINDOWS_OS = 2;
  const LINUX_OS = 3;
  const OTHER_OS = 4;
  
  //const CURRENT_DOJO_VER = '1.9.3';
  //const WHERE_IS_DOJO = '//ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/dojo.js';
  const WHERE_IS_DOJO = 'js/vendor/';
  
  // Database
  const DB_ERROR = -1;
  
  //My Machine
  //pgsql:host=localhost;port=5432;dbname=testdb;user=bruce;password=mypass
  const DB_NAME = 'DBNAME';
  const DB_USERNAME = 'DBUSER';
  const DB_PASSWORD = 'DBPASSWORD';
  
  const VALID_REQUEST_KEY = 'VALID_REQUEST_KEY';
  
  const QUERY_LIMIT = 100;
  
  const REF_TABLE_CODE_ACTION = 1;
  const REF_TABLE_CODE_AGENT = 2;
  const REF_TABLE_CODE_CONDITION = 3;
  const REF_TABLE_CODE_EMERGENCY = 4;
  const REF_TABLE_CODE_FOOTNOTE = 5;
  const REF_TABLE_CODE_GOAL = 6;
  const REF_TABLE_CODE_PRESCRIPTION = 7;
  const REF_TABLE_CODE_PURPOSE = 8;
  const REF_TABLE_CODE_SUBSET = 9;
  const REF_TABLE_CODE_TIMEFRAME = 10;
  
  static $reference_table_names = array(
    self::REF_TABLE_CODE_ACTION => 'lena.ref_action',
    self::REF_TABLE_CODE_AGENT => 'lena.ref_agent',
    self::REF_TABLE_CODE_CONDITION => 'lena.ref_condition',
    self::REF_TABLE_CODE_EMERGENCY => 'lena.ref_emergency',
    self::REF_TABLE_CODE_FOOTNOTE => 'lena.ref_footnote',
    self::REF_TABLE_CODE_GOAL => 'lena.ref_goal',
    self::REF_TABLE_CODE_PRESCRIPTION => 'lena.ref_prescription',
    self::REF_TABLE_CODE_PURPOSE => 'lena.ref_purpose',
    self::REF_TABLE_CODE_SUBSET => 'lena.ref_subset',
    self::REF_TABLE_CODE_TIMEFRAME => 'lena.ref_timeframe'
  );
  
  //
  const DATA_NONE = 'DATA_NONE';
  
  const ERR_CODE_NONE = 1000;
  const ERR_MSG_NONE = 'No error';
  const ERR_CODE_NO_REF_TABLE = 1001;
  const ERR_MSG_NO_REF_TABLE = 'No reference table name was set before selecting reference data';
  const ERR_CODE_INV_TABLE_CODE = 1002;
  const ERR_MSG_INV_TABLE_CODE = 'The code used for the reference table is not valid';
  const ERR_CODE_REQUEST_KEY_REQUIRED = 1003;
  const ERR_MSG_REQUEST_KEY_REQUIRED = 'The search needs to have a valid request key';
  const ERR_CODE_DOCUMENT_NOT_FOUND = 1004;
  const ERR_MSG_DOCUMENT_NOT_FOUND = 'The search returned no Document';
}

?>